﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using QzEbook.Common;

/// <summary>
///  用于内容预设置里面的缩略图生成,有存在的价值;
/// </summary>
public partial class admin_getBitmap : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string path=Request["path"];
        if (String.IsNullOrEmpty(path))
        {
            Response.Write("错误");
        }

        string filepath = Server.MapPath(path);
        if (!File.Exists(filepath))
        {
            return;
        }
        ImageGriphics image = new ImageGriphics(filepath);
        image.OutputSize = Config.BookThumbSize;
        System.Drawing.Image thumb=image.GetThumb();

        Response.ContentType = "image/jpeg";
        Response.Clear();
        thumb.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
        thumb.Dispose();
        Response.Flush();
        Response.End();

    }
}
